import React from 'react';

import Constants from '../../common/Constants';
import BaseAction from '../common/BaseAction';

export default class CommonSendCommentAction extends BaseAction {
  constructor() {
    super();
  }

  call(caller, data) {
    if (caller.state.viewStatus != 2){
      this._baseCall(caller, data);
      this.caller.setState({
        viewStatus:2,
      })
    }
  }

  finish(data, isSucceed, response) {
    if(isSucceed) {
      this.caller.setState({
        viewStatus: 3,
        commentSuccess:true,
      })
    }else{
       this.caller.setState({
        viewStatus: 0
      })
    }
  }
}
